package com.yuanxiao.common.mybatis.constant;

public enum SortDirection {
    ASC, DESC;

    public static SortDirection of(String value) {
        try {
            return value == null ? DESC : value.toUpperCase().trim().equals("ASC") ? ASC : DESC;
        } catch (Exception e) {
            return DESC;
        }
    }
}

/*
调用示例：
String safeDirection = SortDirection.of(orderDirection).name(); // 返回 "ASC" 或 "DESC"
mapper.selectListWithOrder(orderBy, safeDirection);
*/
